using System.Windows;
using System.Windows.Data;

namespace FluentSilverlight.Expressions.TextItems
{
    public class DependencyPropertyBinder : IDependencyPropertyBinder
    {
        private readonly DependencyProperty dependencyProperty;
        private readonly FrameworkElement frameworkElement;

        public DependencyPropertyBinder(FrameworkElement frameworkElement, DependencyProperty dependencyProperty)
        {
            this.dependencyProperty = dependencyProperty;
            this.frameworkElement = frameworkElement;
        }

        public BindingExpressionBase SetBinding(Binding binding)
        {
            return frameworkElement.SetBinding(dependencyProperty, binding);
        }
    }
}